package com.gl.util;
import javafx.application.Application;
import javafx.scene.Scene;
import javafx.scene.layout.Priority;
import javafx.scene.layout.VBox;
import javafx.scene.web.WebEngine;
import javafx.scene.web.WebView;
import javafx.stage.Stage;

public class WebViewer extends Application {

    private WebEngine engine;

    @Override
    public void start(Stage primaryStage) {
        WebView webView = new WebView();
        engine = webView.getEngine();
        // 加载网页
        engine.load("https://www.kuaifaka.net/purchasing?link=Mb5ql2VI");

        VBox root = new VBox();
        VBox.setVgrow(webView, Priority.ALWAYS);
        root.getChildren().add(webView);

        Scene scene = new Scene(root, 800, 600);

        primaryStage.setTitle("网页浏览器");
        primaryStage.setScene(scene);
        primaryStage.show();
    }

    public static void main(String[] args) {
        launch(args);
    }

    public static void reload() {
        launch();
    }
}

